package com.service.finanial.controller;

import com.client.model.system.FinancialUserVo;
import com.client.model.system.LoginUserVo;
import com.client.model.vo.common.Result;
import com.client.model.vo.common.ResultCodeEnum;
import com.service.finanial.service.FinancialItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/airui/api/aaa")
public class MyController {
    @Autowired
    private FinancialItemService financialItemService;
    @GetMapping("/findAll")
    public Result list(){
        return Result.build(financialItemService.finAll(), ResultCodeEnum.SUCCESS);
    }

    @GetMapping("/myList")
    //map<String,String>
    public Result mylist(@RequestHeader("token")String token){
        return Result.build(financialItemService.myList(token),ResultCodeEnum.SUCCESS);
    }
    @GetMapping("/sell")
    public Result sell(@RequestHeader("token") String token, Integer id,Integer remark,Integer riskLevel,Integer startMoney){
        System.err.println(remark);
        System.err.println(riskLevel);
        System.err.println(startMoney);
        return financialItemService.sell(token,id,remark,riskLevel,startMoney);
    }
}
